package com.j180.config;


import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ComponentScan("com.j180.*")
@Import(MyBatisConfig.class)
@EnableWebMvc
public class SpringConfig implements WebMvcConfigurer  {

     //处理静态文件的
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
         //放行 /html路径下的资源文件
        //registry.addResourceHandler("/html/*").addResourceLocations("classpath:/html/");
        //registry.addResourceHandler("/layui/**").addResourceLocations("classpath:/layui/");

        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
    }
    

}
